#ifndef __DS_TASK__INCLUDE__
#define __DS_TASK__INCLUDE__

#include "dk_core.h"
#include "conn.h"
#include "ds_proto.h"

class DSTask {
public:
  DSTask() : in_buf_(NULL), out_buf_(NULL), cli_conn_(NULL)
  {
  }

  ~DSTask() {
    Destroy();
  }

  bool Init(CliConn *cli_conn, struct evbuffer *buf, int buf_size);
  void Destroy();

  void Perform();

  static void PerformDefferCb(DKBaseThread *thread, void *arg);

private:
  bool UploadFile();

private:
  struct evbuffer *in_buf_;
  struct evbuffer *out_buf_;
  CliConn *cli_conn_;
  TrackerHeader in_header_;
};

#endif
